package com.rover.crm.service;

import com.grid.DataGrid;
import com.grid.Page;
import com.rover.crm.entity.PaymentRecords;
import com.rover.system.service.BaseService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 回款记录Service
 */

@Service
@Transactional
public class PaymentRecordsService extends BaseService {
    protected Logger logger = LoggerFactory.getLogger(getClass());

    @Transactional
    public DataGrid query(Page page) throws Exception {
        DataGrid dataGrid = new DataGrid();
        List<PaymentRecords> li = dao.<PaymentRecords>findPageHql(page.getHQL(), page.getWhereParams(), page.getPageNo(),
                page.getPageSize());
        dataGrid.setResult(li);
        dataGrid.setTotalCount(dao.countHql(page.getHQLTotalCount(), page.getWhereParams()));
        return dataGrid;
    }


}
